<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .animation{
            width: 200px;
            height: 200px;
            background-color: red;
            margin:40px auto;
            animation:name 5s linear 0s  infinite alternate;
        }
        .animation:hover{
            animation-play-state: paused;
            /* background-color:rgb(8, 72, 31); */
        }
        @keyframes name{
            from{
                width:200px;
                background-color: red;
            }
            25%{
                width:400px;
                background-color:blue; 
            }
            50%{
                width:600px;
                background-color:aqua;
            }
            75%{
                width:400px;
                background-color:rgb(255, 0, 242);
            }
            to{
                width:200px;
                background-color:green;
            }
        }
    </style>
</head>
<body>
    <div class="animation"></div>
</body>
</html>